home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / ENROLS1.PAK / SECTFORM.CPP < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  130 lines

  1. // SectForm.cpp : implementation of the CSectionForm class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Enroll.h"
  6.  
  7. #include "SectSet.h"
  8. #include "EnrolDoc.h"
  9. #include "SectForm.h"
  10.  
  11. #ifdef _DEBUG
  12. #define new DEBUG_NEW
  13. #undef THIS_FILE
  14. static char THIS_FILE[] = __FILE__;
  15. #endif
  16.  
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CSectionForm
  19.  
  20. IMPLEMENT_DYNCREATE(CSectionForm, CRecordView)
  21.  
  22. BEGIN_MESSAGE_MAP(CSectionForm, CRecordView)
  23.  
  24.  
  25.     //{{AFX_MSG_MAP(CSectionForm)
  26.         // NOTE - the ClassWizard will add and remove mapping macros here.
  27.         //    DO NOT EDIT what you see in these blocks of generated code!
  28.     //}}AFX_MSG_MAP
  29.     // Standard printing commands
  30.     ON_COMMAND(ID_FILE_PRINT, CRecordView::OnFilePrint)
  31.     ON_COMMAND(ID_FILE_PRINT_DIRECT, CRecordView::OnFilePrint)
  32.     ON_COMMAND(ID_FILE_PRINT_PREVIEW, CRecordView::OnFilePrintPreview)
  33. END_MESSAGE_MAP()
  34.  
  35. /////////////////////////////////////////////////////////////////////////////
  36. // CSectionForm construction/destruction
  37.  
  38. CSectionForm::CSectionForm()
  39.     : CRecordView(CSectionForm::IDD)
  40. {
  41.     //{{AFX_DATA_INIT(CSectionForm)
  42.     m_pSet = NULL;
  43.     //}}AFX_DATA_INIT
  44.     // TODO: add construction code here
  45.  
  46. }
  47.  
  48. CSectionForm::~CSectionForm()
  49. {
  50. }
  51.  
  52. void CSectionForm::DoDataExchange(CDataExchange* pDX)
  53. {
  54.     CRecordView::DoDataExchange(pDX);
  55.     //{{AFX_DATA_MAP(CSectionForm)
  56.     DDX_FieldText(pDX, IDC_COURSE, m_pSet->m_CourseID, m_pSet);
  57.     DDX_FieldText(pDX, IDC_SECTION, m_pSet->m_SectionNo, m_pSet);
  58.     DDX_FieldText(pDX, IDC_INSTRUCTOR, m_pSet->m_InstructorID, m_pSet);
  59.     DDX_FieldText(pDX, IDC_ROOM, m_pSet->m_RoomNo, m_pSet);
  60.     DDX_FieldText(pDX, IDC_SCHEDULE, m_pSet->m_Schedule, m_pSet);
  61.     DDX_FieldText(pDX, IDC_CAPACITY, m_pSet->m_Capacity, m_pSet);
  62.     //}}AFX_DATA_MAP
  63. }
  64.  
  65. BOOL CSectionForm::PreCreateWindow(CREATESTRUCT& cs)
  66. {
  67.     // TODO: Modify the Window class or styles here by modifying
  68.     //  the CREATESTRUCT cs
  69.  
  70.     return CRecordView::PreCreateWindow(cs);
  71. }
  72.  
  73. void CSectionForm::OnInitialUpdate()
  74. {
  75.     m_pSet = &GetDocument()->m_sectionSet;
  76.     CRecordView::OnInitialUpdate();
  77. }
  78.  
  79. /////////////////////////////////////////////////////////////////////////////
  80. // CSectionForm printing
  81.  
  82. BOOL CSectionForm::OnPreparePrinting(CPrintInfo* pInfo)
  83. {
  84.     // default preparation
  85.     return DoPreparePrinting(pInfo);
  86. }
  87.  
  88. void CSectionForm::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  89. {
  90.     // TODO: add extra initialization before printing
  91. }
  92.  
  93. void CSectionForm::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
  94. {
  95.     // TODO: add cleanup after printing
  96. }
  97.  
  98. /////////////////////////////////////////////////////////////////////////////
  99. // CSectionForm diagnostics
  100.  
  101. #ifdef _DEBUG
  102. void CSectionForm::AssertValid() const
  103. {
  104.     CRecordView::AssertValid();
  105. }
  106.  
  107. void CSectionForm::Dump(CDumpContext& dc) const
  108. {
  109.     CRecordView::Dump(dc);
  110. }
  111.  
  112. CEnrollDoc* CSectionForm::GetDocument() // non-debug version is inline
  113. {
  114.     ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CEnrollDoc)));
  115.     return (CEnrollDoc*)m_pDocument;
  116. }
  117. #endif //_DEBUG
  118.  
  119. /////////////////////////////////////////////////////////////////////////////
  120. // CSectionForm database support
  121. CRecordset* CSectionForm::OnGetRecordset()
  122. {
  123.     return m_pSet;
  124. }
  125.  
  126.  
  127. /////////////////////////////////////////////////////////////////////////////
  128. // CSectionForm message handlers
  129.  
  130.